package com.wfs.spring.thread.Thread;

/**
 * @Auther: wfs
 * @Date: 2019/6/13 21:10
 * @Description:
 */
public class Subtract {
    private String lockl;

    public Subtract(String lockl) {
        this.lockl = lockl;
    }
    public void subtract(){
        try {
        synchronized (lockl){
           // while (ValueObject.list.size()==0){
                System.out.println("wait begin threadName: "+Thread.currentThread().getName());
                lockl.wait();
                System.out.println("wait end threadName: "+Thread.currentThread().getName());
           // }
            ValueObject.list.remove(0);
            System.out.println(" list site:"+ValueObject.list.size());

        }
        }catch (Exception e){
            e.printStackTrace();
        }


    }
}
